1. Field of the Invention
The invention relates to data storage systems. Specifically, the invention relates to apparatus, systems, and methods for flushing data from a cache to secondary storage.
2. Description of the Related Art
High density, removable media storage libraries are used to provide large quantities of storage in a computer system. Typically, such data storage systems are employed for backup or other secondary storage purposes, but may be used as primary storage in circumstances that are conducive to sequential data access and the like.
The data is stored on media cartridges, such as magnetic or optical disks, that are arranged in storage bins and accessed when data on a cartridge is requested. Currently available media cartridges are capable of storing much more data than the data volume units that correspond to the size of early types of media cartridges. Volume mapping is used to create a correlation between the physical capacity of a storage cartridge (stacked volume or physical volume) and the data storage unit size (virtual volume or logical volume) of a file or block that is stored on the cartridge.
Given the available data storage capacity of a disk, volume mapping allows multiple logical volumes to be stored on a single physical volume, thereby providing an efficient use of the available storage media. A virtual tape server (VTS) is one device capable of creating and maintaining such mapping among physical volumes and logical volumes. The VTS services data storage requests from host computer systems.
A typical VTS system includes a virtual tape server and an automated media library. The library is controlled by a library manager (LM) that is similar to a workstation computer. As needed, the LM conducts the physical loading and unloading of media cartridges from physical drives. Through proper communication of the volume mapping and attributes, or constructs, a host processor and peripheral data storage equipment may access logical volumes as though they were individual physical volumes. The volume access management is provided via the VTS and LM.
A VTS system caches a plurality of logical volumes stored as files, in a cache comprised of a high speed storage device such as a direct access storage device (DASD). Typically, the DASD cache provides random access to data in one or more logical volumes. The DASD cache provides high speed access but is more expensive than the slower, less expensive, secondary storage provided through the LM. Generally, a VTS system includes less DASD cache capacity than secondary storage capacity.
The cache serves as a buffer for logical volumes corresponding to actual physical volumes of secondary storage. The logical volumes may be organized within the cache into data structures referred to as cache structures. Cache structures may have a variety of formats or configurations. A cache manager manages virtual volumes such that the most frequently requested virtual volumes remain in the cache and the least frequently requested virtual volumes are placed in secondary storage.
Initially, the cache is empty. When a host requests a virtual volume, the virtual volume is loaded from secondary storage into the cache. When a host writes a virtual volume, it is written to the cache. Eventually, the cache fills up to a predetermined threshold. As the cache fills beyond the threshold, the cache manager removes virtual volumes from the cache. Generally, the least recently used (LRU) virtual volumes are removed first.
Generally, a VTS writes a copy of a virtual volume in the cache to a secondary storage media cartridge. The copy may be written simultaneous with the writing of the virtual volume in the cache or as free space is needed in the cache. The original virtual volume is left in the cache in case additional cache hits are received for the virtual volume. When a virtual volume is written both in the cache and on secondary storage media cartridges, the virtual volume is “premigrated.”
The VTS tracks metadata for virtual volumes within the cache, such as the size, type, location in cache, a pointer to the virtual volume in secondary storage, and the like. The pointer allows the VTS to readily reload, or “recall,” a virtual volume permanently removed from the cache. Depending on which physical media cartridge a virtual volume is premigrated to, the recall may require as long as several minutes.
In certain VTS systems, once a virtual volume is premigrated, a cache manager may remove the virtual volume from cache to free memory space. Typically, all the storage space occupied by a premigrated virtual volume is reassigned except for the pointer to the location of the virtual volume in secondary storage. This process of freeing space in the cache is referred to herein as “stubbing.” A virtual volume that has been stubbed is “migrated.” The cache memory space freed by migrating the virtual volume is then used to meet the demands for DASD storage being placed on the VTS by one or more hosts.
In some circumstances, a VTS operates in a high demand environment that requires almost constant servicing of data storage requests from hosts. For example, the VTS system may provide data storage for banking applications. As mentioned above, when free space is required in the cache, the VTS frees the space as quickly and efficiently as possible. As a result, a VTS stubs the LRU virtual volumes, or files, first. Typically, the processing overhead required to stub a virtual volume is fixed. Virtual volumes may have different sizes. Consequently, when the demand for space in the cache is high, a VTS stubs the LRU virtual volume that is also the largest because this provides the most free space for the same fixed processing overhead cost required to stub a virtual volume.
Typically, demand for space in the cache is gauged by measuring when the quantity of free space in the cache drops below a free space threshold. When the free space drops below the free space threshold, the VTS stubs stored LRU virtual volumes in the order of largest to smallest. Eventually, depending on the number and size of data storage requests being handled by the VTS, once the VTS stubs a sufficient number of virtual volumes that the amount of free space available again exceeds the free space threshold, a conventional VTS system stops stubbing virtual volumes.
Unfortunately, over time, the VTS cache begins to accumulate a plurality of smaller LRU virtual volumes, because the larger LRU volumes are stubbed before the smaller LRU virtual volumes. The VTS cache may comprise substantially all small LRU virtual volumes with a few larger LRU virtual volumes. Consequently, when the demand for free space increases, meaning the amount of free space again falls below the free space threshold, the VTS operates very inefficiently. Stubbing a smaller LRU virtual volume incurs the same fixed processing overhead, but frees a smaller amount of space in the cache.
Accordingly, what is needed is an apparatus, system, and method to overcome the inefficiencies of conventional VTS stubbing. In particular, the apparatus, system, and method should identify virtual volumes that have high priority and low priority. In addition, the apparatus, system, and method should flush virtual volumes having low priority according to a first scheme during a demand load and according to a second scheme during substantially no demand load. Such an apparatus, system, and method are provided herein.